/**
 * *****************************************
 * Project: cone
 * File: ResourceHandlerContext.java
 * Creation Date: 9:33:01 PM
 * Creator: Ahmed Fawzy
 * *****************************************
 * Copyright © 2012 Devariance.
 */

package com.devariance.cone.handler;

import com.devariance.cone.handler.exception.ResourceHandlerException;

/**
 * Represents a class loader for classes that are part of a
 * {@link ResourceHandler}.
 * 
 * @author Ahmed Fawzy
 * @version 1.0
 * @see ClassLoader
 * @see ResourceHandlerContext
 * @see ResourceHandler
 */
public interface ResourceHandlerClassLoader {

	/**
	 * Gets the classLoader.
	 * 
	 * @return the classLoader
	 */
	public ClassLoader getClassLoader();

	/**
	 * Must be overridden to load the required classes.
	 * 
	 * @return The {@link ClassLoader} that contains all the loaded classes.
	 * @throws ResourceHandlerException
	 *             If loading fails for some reason.
	 */
	ClassLoader load() throws ResourceHandlerException;

	/**
	 * Unloads the loaded classes.
	 */
	void unload();
}
